package com.aivin.waterfallflow.tool;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.aivin.waterfallflow.R;

public class LoadingDialogUtils {

    public static Dialog getLoadingDialogInstance(Context context) {
        Dialog loadingDialog = new Dialog(context, R.style.iosloading_dialog);
        loadingDialog.setCancelable(false);
        // 设置自定义布局
        /*LayoutInflater inflater = LayoutInflater.from(context);
        View v = inflater.inflate(R.layout.wk_loading_dialog, null);
        LinearLayout layout = v.findViewById(R.id.dialog_view);
        int width = MyDeviceInforHelper.getWidth((Activity) context);
        int height = MyDeviceInforHelper.getRealHeight( (Activity) context) ;
        ViewGroup.LayoutParams layoutParams = new  ViewGroup.LayoutParams(  width   , height);
        loadingDialog.setContentView(layout, layoutParams );
        layout.setBackgroundColor(Color.parseColor("#80000000"));// 设置自定义背景颜色
        // Dialog ,loadingDialog
        loadingDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));// 设置window背景
        loadingDialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);*/
        return loadingDialog;
    }
}
